package com.helmlabs.grouper.cms.model;

import java.io.IOException;

import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.helmlabs.grouper.forms.dao.FormDao;
import com.helmlabs.grouper.forms.dao.FormDaoXml;
import com.helmlabs.grouper.forms.model.Form;
import com.helmlabs.grouper.forms.view.FreemarkerView;

@Entity
@Table(name="staticcontent")
@PrimaryKeyJoinColumn(name="module_id")
public class StaticContentModule extends AbstractModule {
	
	private String content;

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public String displayAdminForm(HttpServletRequest req, HttpServletResponse response){
		FormDao formDao = new FormDaoXml();
		Form form = formDao.get(new Long(1));
		FreemarkerView view = new FreemarkerView();
		String result = "";
		result = view.render(form).toString();
		return result;
	}
	
}
